<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
    response.setHeader("X-Frame-Options","SAMEORIGIN");
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<head>
  <title> Login </title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="css/login/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="css/login/animate.css" type="text/css" />
    <link rel="stylesheet" href="css/login/font-awesome.min.css" type="text/css" />
    <link rel="stylesheet" href="css/login/simple-line-icons.css" type="text/css" />
    <link rel="stylesheet" href="css/login/font.css" type="text/css" />
    <link rel="stylesheet" href="css/login/app.css" type="text/css" />
    <link href="/assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/bui-min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/page-min.css" rel="stylesheet" type="text/css" />   <!-- 下面的样式，仅是为了显示代码，而不应该在项目中使用-->
   <link href="/assets/css/prettify.css" rel="stylesheet" type="text/css" />
   <style type="text/css">
    code {
      padding: 0px 4px;
      color: #d14;
      background-color: #f7f7f9;
      border: 1px solid #e1e1e8;
    }
   </style>
 </head>
<%-- <body>--%>
<%--  --%>
<%--  <div class="container" style="margin:0 auto; width:400px;">--%>
<%--  <div class="row form-actions actions-bar">--%>
<%--            <div class="span13 offset3 " style="width:400px;">--%>
<%--              Login--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    <div class="row">--%>
<%--      <form id="J_Form" action="/loginInto" method="post" class="form-horizontal span24 container">--%>
<%--        <div class="row">--%>
<%--          <div class="control-group span8">--%>
<%--            <label class="control-label"><s>*</s>用户名：</label>--%>
<%--            <div class="controls">--%>
<%--              <input name="username" type="text" data-rules="{required:true}" class="input-normal control-text">--%>
<%--            </div>--%>
<%--          </div>--%>
<%--        </div>--%>
<%--        <div class="row">--%>
<%--          <div class="control-group span8">--%>
<%--            <label class="control-label"><s>*</s>密码：</label>--%>
<%--            <div class="controls">--%>
<%--              <input name="password" type="password" data-rules="{required:true}" class="input-normal control-text">--%>
<%--            </div>--%>
<%--          </div>--%>
<%--        </div>--%>
<%--      --%>
<%--        <div class="row form-actions actions-bar">--%>
<%--            <div class="span13 offset3 " style="width:400px;">--%>
<%--              <button type="submit" class="button button-primary">保存</button>--%>
<%--              <button type="reset" class="button">重置</button>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--      </form>--%>
<%--    </div>--%>
<%--    --%>

<%--  </div>--%>
<%--  <script type="text/javascript" src="/assets/js/jquery-1.8.1.min.js"></script>--%>
<%--  <script type="text/javascript" src="/assets/js/bui-min.js"></script>--%>

<%--  <script type="text/javascript" src="/assets/js/config-min.js"></script>--%>
<%--  <script type="text/javascript">--%>
<%--    BUI.use('common/page');--%>
<%--  </script>--%>
<%--  <!-- 仅仅为了显示代码使用，不要在项目中引入使用-->--%>
<%--  <script type="text/javascript" src="/assets/js/prettify.js"></script>--%>
<%--  <script type="text/javascript">--%>
<%--    $(function () {--%>
<%--      prettyPrint();--%>
<%--    });--%>
<%--  </script> --%>
<%--<script type="text/javascript">--%>
<%--  BUI.use('bui/form',function (Form) {--%>
<%--    var form = new Form.HForm({--%>
<%--      srcNode : '#J_Form'--%>
<%--    });--%>

<%--    form.render();--%>
<%--  });--%>
<%--</script>--%>

<%--<body>--%>




<body ng-app="myApp" class="body" >

<!-- jQuery -->
<script src="/js/jquery/jquery.min.js"></script>

<!-- Angular -->
<script src="/js/angular/angular.js"></script>

<script src="/js/angular/angular-animate/angular-animate.js"></script>
<script src="/js/angular/angular-cookies/angular-cookies.js"></script>
<script src="/js/angular/angular-resource/angular-resource.js"></script>
<script src="/js/angular/angular-sanitize/angular-sanitize.js"></script>
<!-- modal template -->
<script type="text/ng-template" id="myModelContent.html">
    <div class="modal-header">
        <h3 class="modal-title">创建用户</h3>
    </div>
    <div class="modal-body">
        <form name="creatForm" class="form-validation ng-pristine ng-valid-email ng-invalid ng-invalid-required">
            <div class="list-group list-group-sm">
                <div class="list-group-item">
                    <input placeholder="Email" name="creatEmail" class="form-control no-border ng-pristine ng-valid-email ng-invalid ng-invalid-required ng-touched"
                           ng-model="creatUser.email" required type="email">
                </div>
                <div class="list-group-item">
                    <input placeholder="Password" name="creatPassword"
                           class="form-control no-border ng-pristine ng-invalid ng-invalid-required ng-touched"
                           ng-model="creatUser.password" required type="password">
                </div>
            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button type="submit" ng-click="ok()" class="btn btn-primary"
                ng-disabled="creatForm.creatEmail.$invalid || creatForm.creatPassword.$invalid">确认</button>
        <button class="btn btn-warning" ng-click="cancel()">退出</button>
    </div>
</script>



<!-- load js -->


<script
        src="http://cdn.bootcss.com/angular-ui-bootstrap/0.11.2/ui-bootstrap-tpls.js"></script>
<div class="app ng-scope app-header-fixed app-aside-fixed" id="app"
     ng-class="{'app-header-fixed':app.settings.headerFixed, 'app-aside-fixed':app.settings.asideFixed, 'app-aside-folded':app.settings.asideFolded, 'app-aside-dock':app.settings.asideDock, 'container':app.settings.container}"
     ui-view="" ng-controller="modalDemo">
    <!-- uiView:  -->
    <div ui-view="" class="fade-in-right-big smooth ng-scope">
        <div class="container w-xxl w-auto-xs ng-scope text-center">
            <a href="" class="navbar-brand block m-t ng-binding">Login</a>
            <div class="m-b-lg">
                <div class="wrapper text-center">
                    <strong>Sign in to get in touch</strong>
                </div>
                <form name="form"
                      class="form-validation  ng-valid-email ng-invalid ng-invalid-required"
                      action="/login" method="post">
                    <div class="list-group list-group-sm">
                        <div class="list-group-item">
                            <input placeholder="Email" name="username"
                                   class="form-control no-border ng-pristine ng-valid-email ng-invalid ng-invalid-required ng-touched"
                                   ng-model="user.email" required type="email">
                        </div>
                        <div class="list-group-item">
                            <input placeholder="Password" name="password"
                                   class="form-control no-border ng-pristine ng-invalid ng-invalid-required ng-touched"
                                   ng-model="user.password" required type="password">
                        </div>
                    </div>
                    <button type="submit" class="btn btn-lg btn-primary btn-block"
                            ng-disabled="form.username.$invalid || form.password.$invalid">Log
                        in</button>
                    <div class="text-center m-t m-b">
                        <a ui-sref="access.forgotpwd" href="javascript:alert('未开通！')">Forgot
                            password?</a>
                    </div>
                </form>
                <button class="btn btn-lg btn-default btn-block" ng-click="open()">Create an account</button>
            </div>
        </div>
    </div>
</div>


<script>

    angular.module('myApp', [ 'ui.bootstrap' ]).controller('modalDemo', function($scope, $modal, $log) { // list
        $scope.items = [ 'angularjs', 'backbone', 'canjs', 'Ember', 'react' ];

        // open click
        $scope.open = function(size) {
            var modalInstance = $modal.open({ templateUrl : 'myModelContent.html',
                controller :'ModalInstanceCtrl',
                size : size,
                resolve : { items : function() {
                        return $scope.items;
                    }
                }
            });
            modalInstance.result.then(function(messageItem) {
                $scope.user = messageItem;
            }, function() {
                $log.info('Modal dismissed at: ' + new Date()) }); } })
        //模态窗口控制
        .controller('ModalInstanceCtrl', function($scope, $modalInstance,$http) {

            // ok click
            $scope.ok = function() {
                $http.post("permit/creatUser",$scope.creatUser).then(function(result){
                    alert(result.data.success);
                    $modalInstance.close($scope.creatUser);
                },function(error){
                    alert("error");
                })

            };
            // cancel click
            $scope.cancel = function() {
                $modalInstance.dismiss('cancel');
            }
        });

</script>

</body>

</html> 